import React, { Component } from 'react';
import Comp2 from './Comp2'
import Comp3 from './Comp3'
import { MyContent } from '../store'
class Comp1 extends Component {
	render() {
		return (
			// 方式一： 第三部 引入context 数据
			<MyContent.Consumer>
				{
					value => {
						return value.flag ? <Comp2></Comp2> : <Comp3></Comp3>
					}
				}
			</MyContent.Consumer>
		);
	}
}

export default Comp1;
